package co.rcantor.dev.siasar.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DBCreator extends SQLiteOpenHelper{
	
	String[] update = null;

	public DBCreator(Context context, String name, CursorFactory factory,int version) {
		super(context, name, factory, version);
	}

	public void onCreate(SQLiteDatabase db) {
		for(int i=0;i<7;i++){
    	 	db.execSQL(ManejadorPropiedades.getQuery("db.ini"+i));
    	 }
	}

	public void onUpgrade(SQLiteDatabase db, int ov, int nv) {//database,oldversion,newversion
		for(String consulta:update){
			if(consulta.length()>2)
				db.execSQL(consulta);
    	 }
	}
	
	public String[] getUpdate() {
		return update;
	}

	public void setUpdate(String[] update) {
		this.update = update;
	}

}
